<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<body>
<?php
include("db.php");
include("config.php");
?>
<table border="0" align="left">
	<tr>
		<td>
			<br>
			<br>
<?
if (isset($_COOKIE["user"]))
{
	echo "<br>Welcome " . $_COOKIE["user"] . "!
			<hr>
			<a href='$site_url'>
				Home
			</a>
			<br>
			<a href='$site_url/logout.php'>
				Logout
			</a>
			<br>
			<a href='$site_url/members'>
				Members Area
			</a>
			<br>";
	$query = "SELECT * FROM users WHERE status='2'";
	$result = mysql_query($query);
	while ($row = mysql_fetch_array($result))
	{
		if ($_COOKIE["user"] == $row['username'])
		{
	if ($_COOKIE["pass"] ==  $row["password"])
	{
		echo "<a href='$site_url/admin'>
			  	Admin Panel
			  </a>
			  <br>
			  <a href='$site_url/news/admin/post.php'>
			  	Post News
			  </a>
			  <br>
			  <a href='$site_url/index.php?view=all'>
			  	News Archive
			  </a>";
	}
		}
}
}
else
{
	echo "Welcome guest!<br /> <a href='$site_url/login.php'>Login</a><br><a href='$site_url/register.php'>Register</a><br><a href='$site_url/index.php?view=all'>News Archive</a>";
}
?>
		</td>
	</tr>
	<tr>
		<td>
<?php
include('online.php');
?>
</table>
</body>